# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DataFusion.V1.Model.NetworkConfig do
  @moduledoc """
  Network configuration for a Data Fusion instance. These configurations are used for peering with the customer network. Configurations are optional when a public Data Fusion instance is to be created. However, providing these configurations allows several benefits, such as reduced network latency while accessing the customer resources from managed Data Fusion instance nodes, as well as access to the customer on-prem resources.

  ## Attributes

  *   `connectionType` (*type:* `String.t`, *default:* `nil`) - Optional. Type of connection for establishing private IP connectivity between the Data Fusion customer project VPC and the corresponding tenant project from a predefined list of available connection modes. If this field is unspecified for a private instance, VPC peering is used.
  *   `ipAllocation` (*type:* `String.t`, *default:* `nil`) - Optional. The IP range in CIDR notation to use for the managed Data Fusion instance nodes. This range must not overlap with any other ranges used in the Data Fusion instance network. This is required only when using connection type VPC_PEERING. Format: a.b.c.d/22 Example: 192.168.0.0/22
  *   `network` (*type:* `String.t`, *default:* `nil`) - Optional. Name of the network in the customer project with which the Tenant Project will be peered for executing pipelines. In case of shared VPC where the network resides in another host project the network should specified in the form of projects/{host-project-id}/global/networks/{network}. This is only required for connectivity type VPC_PEERING.
  *   `privateServiceConnectConfig` (*type:* `GoogleApi.DataFusion.V1.Model.PrivateServiceConnectConfig.t`, *default:* `nil`) - Optional. Configuration for Private Service Connect. This is required only when using connection type PRIVATE_SERVICE_CONNECT_INTERFACES.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :connectionType => String.t() | nil,
          :ipAllocation => String.t() | nil,
          :network => String.t() | nil,
          :privateServiceConnectConfig =>
            GoogleApi.DataFusion.V1.Model.PrivateServiceConnectConfig.t() | nil
        }

  field(:connectionType)
  field(:ipAllocation)
  field(:network)

  field(:privateServiceConnectConfig,
    as: GoogleApi.DataFusion.V1.Model.PrivateServiceConnectConfig
  )
end

defimpl Poison.Decoder, for: GoogleApi.DataFusion.V1.Model.NetworkConfig do
  def decode(value, options) do
    GoogleApi.DataFusion.V1.Model.NetworkConfig.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DataFusion.V1.Model.NetworkConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
